package com.enjoy.resp;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@AllArgsConstructor
@NoArgsConstructor
@Data
public class TranscriptionResponse {

    @JsonProperty("TaskId")
    private String taskId;

    @JsonProperty("Transcription")
    private TranscriptionBean transcription;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class TranscriptionBean {

        @JsonProperty("AudioInfo")
        private AudioInfoBean audioInfo;

        @JsonProperty("Paragraphs")
        private List<ParagraphsBean> paragraphs;

        @JsonProperty("AudioSegments")
        private List<List<Integer>> audioSegments;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        public static class AudioInfoBean {

            @JsonProperty("Duration")
            private int duration;
        }

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        public static class ParagraphsBean {

            @JsonProperty("ParagraphId")
            private String paragraphId;

            @JsonProperty("SpeakerId")
            private String speakerId;

            @JsonProperty("Words")
            private List<WordsBean> words;

            @Data
            @AllArgsConstructor
            @NoArgsConstructor
            public static class WordsBean {

                @JsonProperty("Id")
                private int id;

                @JsonProperty("SentenceId")
                private int sentenceId;

                @JsonProperty("Start")
                private int start;

                @JsonProperty("End")
                private int end;

                @JsonProperty("Text")
                private String text;
            }
        }
    }
}